const fs=require('fs'); 
let rest=fs.readFileSync('persons.json','utf-8')
let obj=JSON.parse(rest)
let user = { username: "admin3", password: "12345" }; 
if (obj.some((item) => item.username == user.username)) {
  if (
    obj.find((item) => item.username == user.username).password ==
    user.password
  ) {
    console.log("登陆成功");
  } else {
      console.log("用户密码错误");
  }
} else {
  console.log("该用户不存在");
}